package world.edges;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import world.placement.Direction;
import world.square.Square;

/**
 * Test class for borders.
 */

public class BorderTest {
	public static Square square;
	public static Border border;
    
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}
	
    @Before
    public void setUp() throws Exception {
            square = new Square(Direction.EAST);
            border = new Border(new Door(false),Direction.NORTH);
    }
    
    @After
    public void tearDown() throws Exception {
    }

    @Test
    public final void isProperSquare_TrueCase(){
    	square.addBorders(border);
    	assertTrue(border.isProperSquare(square));
    }
    
    @Test
    public final void isProperSquare_FalseCase(){
    	assertFalse(border.isProperSquare(square));
    }
    
    @Test
    public final void oppositeBorder_SingleCase(){
    	assertTrue(border.oppositeBorder().getDirection().equals(Direction.SOUTH));
    }
    
    @Test
    public final void isValidBorderElement_TrueCase(){
    	assertTrue(Border.isValidBorderElement(new Wall(false)));
    }
    @Test
    public final void isValidDirection_TrueCase(){
    	assertTrue(Border.isValidDirection(Direction.SOUTH));
    }
}
